const mongoose = require('mongoose');
const config = require('dotenv').config({ path: `.env.${process.env.NODE_ENV}` });
const APP_CONFIG = config.parsed;
const connectionString = `mongodb://${APP_CONFIG.MONGO_USERNAME}:${APP_CONFIG.MONGO_PASSWORD}@${APP_CONFIG.MONGO_HOST}:${APP_CONFIG.MONGO_PORT}/${APP_CONFIG.MONGO_DBNAME}?authSource=admin`;

mongoose.connect(connectionString, { })
    .then(() => {
        console.log('mongo Database connection successful');
    })
    .catch(err => {
        console.error('mongo Database connection error', err);
    });

   
